from sqlalchemy import Table, MetaData, Column, Integer, String, ForeignKey
from sqlalchemy.orm import registry
mapper_registry = registry()
Base = mapper_registry.generate_base()

class Users(Base):
    __tablename__ = "users"
    u_id = Column(String(32), primary_key=True)
    user_name = Column(String(32))
    pass_word = Column(String(32))
    u_name = Column(String(20))
    gender = Column(String(4))
    age = Column(Integer)
    phone = Column(String(11))
    def __init__(self,u_id=None,user_name=None,pass_word=None,u_name=None,gender=None,age=None,phone=None):
        self.u_id = u_id
        self.user_name = user_name
        self.pass_word = pass_word
        self.u_name = u_name
        self.gender = gender
        self.age = age
        self.phone = phone


    def format_str(self):
        return  "u_id: %s,user_name: %s,pass_word: %s,u_name: %s,gender: %s,age: %s,phone: %s" % (self.u_id,self.user_name,self.pass_word,self.u_name,self.gender,self.age,self.phone)






